home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4782 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  1.7 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news text default
99% file C source text default
98% file C source, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 62 6c | 61 63 6b 2e 77 65 65 67 |Path: bl|ack.weeg|
|00000010| 2e 75 69 6f 77 61 2e 65 | 64 75 21 72 6f 62 69 6e |.uiowa.e|du!robin|
|00000020| 73 6f 6e 0a 46 72 6f 6d | 3a 20 54 68 65 20 41 6d |son.From|: The Am|
|00000030| 6f 72 70 68 6f 75 73 20 | 4d 61 73 73 20 3c 72 6f |orphous |Mass <ro|
|00000040| 62 69 6e 73 6f 6e 40 62 | 6c 75 65 2e 77 65 65 67 |binson@b|lue.weeg|
|00000050| 2e 75 69 6f 77 61 2e 65 | 64 75 3e 0a 4e 65 77 73 |.uiowa.e|du>.News|
|00000060| 67 72 6f 75 70 73 3a 20 | 63 6f 6d 70 2e 6c 61 6e |groups: |comp.lan|
|00000070| 67 2e 63 0a 53 75 62 6a | 65 63 74 3a 20 52 65 3a |g.c.Subj|ect: Re:|
|00000080| 20 48 65 6c 70 20 6f 6e | 20 72 61 6e 64 6f 6d 20 | Help on| random |
|00000090| 6e 75 6d 62 65 72 73 0a | 44 61 74 65 3a 20 54 75 |numbers.|Date: Tu|
|000000a0| 65 2c 20 36 20 46 65 62 | 20 31 39 39 36 20 31 37 |e, 6 Feb| 1996 17|
|000000b0| 3a 34 39 3a 34 33 20 2d | 30 36 30 30 0a 4f 72 67 |:49:43 -|0600.Org|
|000000c0| 61 6e 69 7a 61 74 69 6f | 6e 3a 20 55 6e 69 76 65 |anizatio|n: Unive|
|000000d0| 72 73 69 74 79 20 6f 66 | 20 49 6f 77 61 2c 20 49 |rsity of| Iowa, I|
|000000e0| 6f 77 61 20 43 69 74 79 | 2c 20 49 41 2c 20 55 53 |owa City|, IA, US|
|000000f0| 41 0a 44 69 73 74 72 69 | 62 75 74 69 6f 6e 3a 20 |A.Distri|bution: |
|00000100| 77 6f 72 6c 64 0a 4d 65 | 73 73 61 67 65 2d 49 44 |world.Me|ssage-ID|
|00000110| 3a 20 3c 50 69 6e 65 2e | 41 33 32 2e 33 2e 39 31 |: <Pine.|A32.3.91|
|00000120| 2e 39 36 30 32 30 36 31 | 37 34 34 31 32 2e 31 38 |.9602061|74412.18|
|00000130| 35 38 34 33 43 2d 31 30 | 30 30 30 30 40 62 6c 61 |5843C-10|0000@bla|
|00000140| 63 6b 2e 77 65 65 67 2e | 75 69 6f 77 61 2e 65 64 |ck.weeg.|uiowa.ed|
|00000150| 75 3e 0a 52 65 66 65 72 | 65 6e 63 65 73 3a 20 3c |u>.Refer|ences: <|
|00000160| 34 66 37 31 39 33 24 34 | 62 69 40 6a 61 72 69 6e |4f7193$4|bi@jarin|
|00000170| 67 2e 6d 79 3e 20 3c 44 | 4d 44 33 6f 6f 2e 31 43 |g.my> <D|MD3oo.1C|
|00000180| 46 40 75 6e 64 65 72 67 | 72 61 64 2e 6d 61 74 68 |F@underg|rad.math|
|00000190| 2e 75 77 61 74 65 72 6c | 6f 6f 2e 63 61 3e 0a 4e |.uwaterl|oo.ca>.N|
|000001a0| 4e 54 50 2d 50 6f 73 74 | 69 6e 67 2d 48 6f 73 74 |NTP-Post|ing-Host|
|000001b0| 3a 20 62 6c 61 63 6b 2e | 77 65 65 67 2e 75 69 6f |: black.|weeg.uio|
|000001c0| 77 61 2e 65 64 75 0a 4d | 69 6d 65 2d 56 65 72 73 |wa.edu.M|ime-Vers|
|000001d0| 69 6f 6e 3a 20 31 2e 30 | 0a 43 6f 6e 74 65 6e 74 |ion: 1.0|.Content|
|000001e0| 2d 54 79 70 65 3a 20 54 | 45 58 54 2f 50 4c 41 49 |-Type: T|EXT/PLAI|
|000001f0| 4e 3b 20 63 68 61 72 73 | 65 74 3d 55 53 2d 41 53 |N; chars|et=US-AS|
|00000200| 43 49 49 0a 58 2d 53 65 | 6e 64 65 72 3a 20 72 6f |CII.X-Se|nder: ro|
|00000210| 62 69 6e 73 6f 6e 40 62 | 6c 61 63 6b 2e 77 65 65 |binson@b|lack.wee|
|00000220| 67 2e 75 69 6f 77 61 2e | 65 64 75 0a 49 6e 2d 52 |g.uiowa.|edu.In-R|
|00000230| 65 70 6c 79 2d 54 6f 3a | 20 3c 44 4d 44 33 6f 6f |eply-To:| <DMD3oo|
|00000240| 2e 31 43 46 40 75 6e 64 | 65 72 67 72 61 64 2e 6d |.1CF@und|ergrad.m|
|00000250| 61 74 68 2e 75 77 61 74 | 65 72 6c 6f 6f 2e 63 61 |ath.uwat|erloo.ca|
|00000260| 3e 20 0a 0a 4f 6e 20 54 | 75 65 2c 20 36 20 46 65 |> ..On T|ue, 6 Fe|
|00000270| 62 20 31 39 39 36 2c 20 | 4a 6f 73 65 20 46 65 6c |b 1996, |Jose Fel|
|00000280| 69 78 20 53 61 6e 64 6f | 76 61 6c 20 77 72 6f 74 |ix Sando|val wrot|
|00000290| 65 3a 0a 0a 3e 20 55 73 | 65 20 74 68 65 20 74 69 |e:..> Us|e the ti|
|000002a0| 6d 65 28 29 20 66 75 6e | 63 74 69 6f 6e 20 69 6e |me() fun|ction in|
|000002b0| 20 74 68 65 20 73 72 61 | 6e 64 28 29 20 66 75 6e | the sra|nd() fun|
|000002c0| 63 74 69 6f 6e 2e 0a 3e | 20 69 2e 65 2e 0a 3e 20 |ction..>| i.e..> |
|000002d0| 20 66 6f 72 20 28 20 69 | 20 3d 20 30 3b 20 69 3c | for ( i| = 0; i<|
|000002e0| 31 30 3b 20 69 2b 2b 20 | 29 20 7b 0a 3e 20 09 64 |10; i++ |) {.> .d|
|000002f0| 65 6c 61 79 28 31 30 30 | 30 29 3b 20 20 20 3c 2d |elay(100|0); <-|
|00000300| 20 43 6c 6f 63 6b 20 69 | 73 20 74 6f 6f 20 66 61 | Clock i|s too fa|
|00000310| 73 74 2e 2e 2e 0a 3e 20 | 09 73 72 61 6e 64 28 74 |st....> |.srand(t|
|00000320| 69 6d 65 28 4e 55 4c 4c | 29 29 3b 0a 3e 20 09 63 |ime(NULL|));.> .c|
|00000330| 6f 75 74 20 3c 3c 20 72 | 61 6e 64 28 29 20 25 20 |out << r|and() % |
|00000340| 31 30 3b 0a 3e 20 20 20 | 7d 0a 3e 20 0a 3e 20 57 |10;.> |}.> .> W|
|00000350| 69 6c 6c 20 67 69 76 65 | 20 31 30 20 72 61 6e 64 |ill give| 10 rand|
|00000360| 6f 6d 20 6e 75 6d 62 65 | 72 73 20 66 72 6f 6d 20 |om numbe|rs from |
|00000370| 30 20 2d 20 39 2e 2e 2e | 0a 0a 20 20 20 49 6e 20 |0 - 9...|.. In |
|00000380| 43 2b 2b 2e 2e 2e 0a 0a | 20 20 20 4f 6e 20 61 20 |C++.....| On a |
|00000390| 70 6c 61 74 66 6f 72 6d | 20 74 68 61 74 20 70 72 |platform| that pr|
|000003a0| 6f 76 69 64 65 73 20 74 | 68 65 20 6e 6f 6e 2d 43 |ovides t|he non-C|
|000003b0| 20 66 75 6e 63 74 69 6f | 6e 20 64 65 6c 61 79 28 | functio|n delay(|
|000003c0| 29 2e 2e 2e 0a 0a 20 20 | 20 41 6c 73 6f 2c 20 79 |)..... | Also, y|
|000003d0| 6f 75 20 63 61 6c 6c 20 | 73 72 61 6e 64 28 29 20 |ou call |srand() |
|000003e0| 65 76 65 72 79 20 74 69 | 6d 65 20 79 6f 75 20 63 |every ti|me you c|
|000003f0| 61 6c 6c 20 72 61 6e 64 | 28 29 2e 20 20 54 68 69 |all rand|(). Thi|
|00000400| 73 20 62 72 65 61 6b 73 | 20 28 6f 72 20 0a 6c 61 |s breaks| (or .la|
|00000410| 72 67 65 6c 79 20 72 65 | 6e 64 65 72 73 20 6d 6f |rgely re|nders mo|
|00000420| 6f 74 29 20 72 61 6e 64 | 28 29 27 73 20 61 6c 67 |ot) rand|()'s alg|
|00000430| 6f 72 69 74 68 6d 2e 20 | 20 54 68 69 73 20 41 4e |orithm. | This AN|
|00000440| 53 49 20 43 20 70 72 6f | 67 72 61 6d 20 77 69 6c |SI C pro|gram wil|
|00000450| 6c 20 70 72 69 6e 74 20 | 0a 6f 75 74 20 31 30 20 |l print |.out 10 |
|00000460| 70 73 65 75 64 6f 72 61 | 6e 64 6f 6d 20 6e 75 6d |pseudora|ndom num|
|00000470| 62 65 72 73 20 66 72 6f | 6d 20 30 20 74 6f 20 39 |bers fro|m 0 to 9|
|00000480| 3a 0a 0a 23 69 6e 63 6c | 75 64 65 20 3c 73 74 64 |:..#incl|ude <std|
|00000490| 69 6f 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 20 3c |io.h>.#i|nclude <|
|000004a0| 73 74 64 6c 69 62 2e 68 | 3e 0a 23 69 6e 63 6c 75 |stdlib.h|>.#inclu|
|000004b0| 64 65 20 3c 74 69 6d 65 | 2e 68 3e 0a 0a 69 6e 74 |de <time|.h>..int|
|000004c0| 20 6d 61 69 6e 28 76 6f | 69 64 29 0a 7b 0a 20 20 | main(vo|id).{. |
|000004d0| 20 20 69 6e 74 20 69 3b | 0a 20 20 20 20 73 72 61 | int i;|. sra|
|000004e0| 6e 64 28 74 69 6d 65 28 | 4e 55 4c 4c 29 29 3b 0a |nd(time(|NULL));.|
|000004f0| 20 20 20 20 66 6f 72 20 | 28 69 20 3d 20 30 3b 20 | for |(i = 0; |
|00000500| 69 20 3c 20 39 3b 20 2b | 2b 69 29 20 70 72 69 6e |i < 9; +|+i) prin|
|00000510| 74 66 28 22 25 64 2c 20 | 22 2c 20 72 61 6e 64 28 |tf("%d, |", rand(|
|00000520| 29 20 25 20 31 30 29 3b | 20 0a 20 20 20 20 72 65 |) % 10);| . re|
|00000530| 74 75 72 6e 20 30 3b 0a | 7d 0a 0a 20 20 52 65 66 |turn 0;.|}.. Ref|
|00000540| 65 72 20 74 6f 20 74 68 | 65 20 46 41 51 20 66 6f |er to th|e FAQ fo|
|00000550| 72 20 70 72 6f 62 6c 65 | 6d 73 20 77 69 74 68 20 |r proble|ms with |
|00000560| 74 68 65 20 65 78 70 72 | 65 73 73 69 6f 6e 20 22 |the expr|ession "|
|00000570| 72 61 6e 64 28 29 20 25 | 20 31 30 22 20 2d 2d 20 |rand() %| 10" -- |
|00000580| 69 74 20 0a 64 6f 65 73 | 6e 27 74 20 61 6c 77 61 |it .does|n't alwa|
|00000590| 79 73 20 72 65 73 75 6c | 74 20 69 6e 20 65 73 70 |ys resul|t in esp|
|000005a0| 65 63 69 61 6c 6c 79 20 | 72 61 6e 64 6f 6d 20 6e |ecially |random n|
|000005b0| 75 6d 62 65 72 73 2e 0a | 0a 2f 2a 2a 4a 61 6d 65 |umbers..|./**Jame|
|000005c0| 73 20 52 6f 62 69 6e 73 | 6f 6e 2a 2a 2a 2a 2a 2a |s Robins|on******|
|000005d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000005e0| 2a 20 20 20 20 20 20 20 | 20 20 20 20 20 0a 20 20 |* | . |
|000005f0| 22 41 6e 20 69 6d 70 6f | 72 74 61 6e 74 20 67 6f |"An impo|rtant go|
|00000600| 61 6c 20 6f 66 20 61 6c | 6d 6f 73 74 20 65 76 65 |al of al|most eve|
|00000610| 72 79 20 67 72 61 70 68 | 69 63 73 20 70 72 6f 67 |ry graph|ics prog|
|00000620| 72 61 6d 20 69 73 20 74 | 6f 20 64 72 61 77 20 70 |ram is t|o draw p|
|00000630| 69 63 74 75 72 65 73 20 | 6f 6e 0a 20 74 68 65 20 |ictures |on. the |
|00000640| 73 63 72 65 65 6e 2e 22 | 20 20 20 20 2d 2d 20 4e |screen."| -- N|
|00000650| 65 69 64 65 72 2c 20 44 | 61 76 69 73 20 26 20 57 |eider, D|avis & W|
|00000660| 6f 6f 2c 20 5f 4f 70 65 | 6e 47 4c 5f 50 72 6f 67 |oo, _Ope|nGL_Prog|
|00000670| 72 61 6d 6d 69 6e 67 5f | 47 75 69 64 65 5f 2c 20 |ramming_|Guide_, |
|00000680| 43 68 61 70 74 65 72 20 | 31 30 0a 20 20 20 20 20 |Chapter |10. |
|00000690| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000006a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000006b0| 20 20 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 6a | ******|*******j|
|000006c0| 61 6d 65 73 2d 72 6f 62 | 69 6e 73 6f 6e 40 75 69 |ames-rob|inson@ui|
|000006d0| 6f 77 61 2e 65 64 75 2a | 2a 2f 0a 0a |owa.edu*|*/.. |
+--------+-------------------------+-------------------------+--------+--------+